﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace LoanCalculator.WcfService
{
    [ServiceContract]
    public interface ILCService
    {

        [OperationContract]
        double CalculateMonthlyPayment(
                            double loanAmount,
                            double annualInterestRate,
                            double months,
                            double downPayment,
                            double propertyTax,
                            double propertyInsurance);

        [OperationContract]
        IList<Payments> CalculateAmortization(
                            double loanAmount,
                            double annualInterestRate,
                            double months,
                            double downPayment,
                            double propertyTax,
                            double propertyInsurance);
    }

    [DataContract]
    public class Payments
    {
        [DataMember(Name = "Month", Order = 1)]
        public int Month { get; set; }
        
        [DataMember(Name = "Payment", Order = 2)]
        public double Payment { get; set; }

        [DataMember(Name = "Interest", Order = 3)]
        public double Interest { get; set; }

        [DataMember(Name = "Reduction", Order = 4)]
        public double Reduction { get; set; }

        [DataMember(Name = "Principle", Order = 5)]
        public double Principle { get; set; }
    }
}
